<!--
*
* Copyright 2015 HISP Tanzania
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* @since 2015
* @author Joseph Chingalo profschingalo@gmail.com>
*
*
-->
<div *ngFor="let section of entryFormSections;let currentSectionIndex = index;trackBy: trackByFn">
  <div *ngIf="(currentSectionIndex + 1) == pager.page" class="item-card" no-padding (click)="openSectionList()">
    <ion-item>
      <p ion-text color="font-color" no-padding align="center">
        {{ section.name }}
      </p>
      <div style="text-align: center" item-right>
        <span float-end class="side-menu-icon">
          <img [src]="icons.menu">
        </span>
      </div>
    </ion-item>
  </div>
</div>
<div *ngFor="let section of entryFormSections;let currentSectionIndex = index;trackBy: trackByFn">
  <div *ngIf="(currentSectionIndex + 1) == pager.page">
    <div class="item-card-entry-form">
      <div class="entry-form-container">
        <form>
          <div *ngFor="let dataElement of section.dataElements;trackBy: trackByFn">
            <input-container [dataElement]="dataElement" [currentUser]="currentUser" [(dataValuesSavingStatusClass)]="dataValuesSavingStatusClass"
              [(data)]="dataValuesObject" (onChange)="updateData($event)"></input-container>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>


<data-entry-pagination (onUpdateDataSetCompleteness)="updateDataSetCompleteness()" (onSectionListOpen)="openSectionList()"
  (onPaginationChange)="changePagination($event)" (onViewUserCompletenessInformation)="viewUserCompletenessInformation($event)"
  [pager]="pager" [entryFormType]="entryFormType" [entryFormSectionsCount]="entryFormSections.length"
  [dataSetsCompletenessInfo]="dataSetsCompletenessInfo" [isDataSetCompletenessProcessRunning]="isDataSetCompletenessProcessRunning"
  [isDataSetCompleted]="isDataSetCompleted"></data-entry-pagination>
